package com.jame.other;

import org.apache.log4j.Logger;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

/**
 * @author : Jame
 * @date : 2021-07-01 15:03
 * 启动字符画
 **/
public class StartImage {
    private static Logger logger = Logger.getLogger(StartImage.class);

    public static void printStartImage() {
        BufferedReader b = null;
        StringBuilder sb = new StringBuilder();
        try {
            String path=Thread.currentThread().getContextClassLoader().getResource("characterPainting").getPath();

            File f = new File(path+"/startImage.txt");
            if(!f.exists()){
                return;
            }
            FileReader reader = new FileReader(path+"/startImage.txt");

            String line;
            b = new BufferedReader(reader);
            while ((line = b.readLine()) != null) {
               sb.append(line+"\n");
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if (b != null) {
                    b.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        logger.info(sb.toString());


    }


}
